import { UserLayout } from '@/layouts'
import { AppRouteModule } from '/#/types'

export const REDIRECT_NAME = 'Redirect'

export const PARENT_LAYOUT_NAME = 'ParentLayout'

export const PAGE_NOT_FOUND_NAME = 'PageNotFound'

// 前端未找到页面路由（固定不用改）
export const PAGE_NOT_FOUND_ROUTE = {
  path: '*',
  redirect: '/404',
  hidden: true,
  name: 'NotFoundRouter',
}

// 根级菜单
export const RootRouter: AppRouteModule = {
  key: '',
  name: 'root',
  path: '/',
  component: 'BasicLayout',
  redirect: '/dashboard',
  children: [],
  meta: {
    title: '首页',
  },
}

export const IFRAME = () => import('/@/views/sys/iframe/FrameBlank.vue')
export const Exception404 = () => import('/@/views/exception/404.vue')
export const EXCEPTION_COMPONENT = () => import('/@/views/sys/exception/Exception.vue')
/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  // 用户登录页
  {
    path: '/passport',
    component: UserLayout,
    redirect: '/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import('/@/views/sys/login/index.vue'),
      },
    ],
  },

  // 404页
  {
    path: '/404',
    component: Exception404,
  },
]
